# 导入前置库
import requests
import os
import sys
menu_items = ["/search 'Song' 搜索指定名称的歌曲", "Item 2", "Item 3", "Item 4", "Item 5", "Item 6", "Item 7", "Item 8", "Item 9", "Item 10", "Item 11", "Item 12"]
page_size = 8  # 每页显示的菜单项数量
current_page = 0  # 当前显示的页面编号
while True:
    start_item = current_page * page_size
    end_item = (current_page + 1) * page_size
    items_to_show = menu_items[start_item:end_item]
    print("====== Menu (页面 {}/{}) ======".format(current_page + 1, len(menu_items) // page_size + 1))
    for item in items_to_show:
        print("- {}".format(item))
    choice = input("\n输入 'next' 切换到下一页, 'p' 返回上一页, 或者输入 'q' 关闭菜单: ")
    if choice == 'next':
        current_page += 1
        if current_page > len(menu_items) // page_size:
            current_page = 0
    elif choice == 'p':
        current_page -= 1
        if current_page < 0:
            current_page = len(menu_items) // page_size
    elif choice == 'q':
        break
    else:
        print("无法识别的代码请重试")
print("NeteaseTools By:Alcex version:Beta1.0"
      "网易云工具箱功能菜单 输入/menu可再次调用菜单"
      "/search 'Song' 搜索指定名称的歌曲"
      "/download 'Songid/Listid/Shareurl' 下载歌曲或批量下载歌单中的所有歌曲到当前目录"
      "/set 'User/Listid'设置用户名/歌单id"
      "/info 'Songid/listid' 查询歌曲或歌单信息"
      "/uplate 更新至最新版本"
      "/config set.url 'url'更改解析源"
      "/config set.metting-url 'url'更改metting源"
      "/login for qrcode 使用扫码登录网易云"
      "")